/**
 * Created with IntelliJ IDEA.
 * User: aermakov
 * Date: 24.05.13
 * Time: 13:17
 * To change this template use File | Settings | File Templates.
 */

Ext.ns('GrailsCompany.form');

GrailsCompany.form.ProjectForm = Ext.extend(GrailsCompany.form.CRUDFormPanel, {
    constructor: function (config) {
        config = Ext.apply({
            border: false,
            monitorValid: true,
            defaultType: 'textfield',
            items: [
                {
                    fieldLabel: 'Title',
                    name: 'title',
                    allowBlank: false,
                    width: 150
                },
                {
                    fieldLabel: 'Description',
                    name: 'description',
                    xtype: 'textarea',
                    maxLength: 1000,
                    emptyText: 'No description provided',
                    width: 150
                }//,
//                new Ext.ux.form.FileUploadField({
//                    buttonOnly: true,
//                    width: 50,
//                    listeners: {
//                        'fileselected': function(fb, v){
//                            var el = Ext.fly('fi-button-msg');
//                            el.update('<b>Selected:</b> '+v);
//                            if(!el.isVisible()){
//                                el.slideIn('t', {
//                                    duration: .2,
//                                    easing: 'easeIn',
//                                    callback: function(){
//                                        el.highlight();
//                                    }
//                                });
//                            }else{
//                                el.highlight();
//                            }
//                        }
//                    }
//                })
            ]
        }, config);

        GrailsCompany.form.ProjectForm.superclass.constructor.call(this, config);
    }
});
Ext.reg('prjform', GrailsCompany.form.ProjectForm);
